package com.yunyao.dao.service.bamu.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunyao.common.constant.enums.DataDeletedStatus;
import com.yunyao.dao.mapper.BamuProjectMemberMapper;
import com.yunyao.dao.model.BamuProjectMember;
import com.yunyao.dao.service.bamu.IBamuProjectMemberService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 供应商合作信息表 服务实现类
 * </p>
 *
 * @author xingjishuai
 * @since 2024-07-02
 */
@Service
public class BamuProjectMemberServiceImpl extends ServiceImpl<BamuProjectMemberMapper, BamuProjectMember> implements IBamuProjectMemberService {

    @Override
    public Boolean deleteById(String id) {
        LambdaUpdateWrapper<BamuProjectMember> wrapper =
                new LambdaUpdateWrapper<BamuProjectMember>().eq(BamuProjectMember::getId, id).set(BamuProjectMember::getIsDeleted, DataDeletedStatus.YES.getType());
        return update(wrapper);
    }

    @Override
    public BamuProjectMember getByIdNoDel(String id) {
        LambdaQueryWrapper<BamuProjectMember> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BamuProjectMember::getId, id).eq(BamuProjectMember::getIsDeleted, DataDeletedStatus.NO.getType());
        return getOne(wrapper);
    }
}
